﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[RequireComponent(typeof(Camera))]
public class CameraController : MonoBehaviour {

    Vector3 fixedDisplacement;
    Transform focusingTransform;

	// Use this for initialization
	void Start ()
    {
        fixedDisplacement = transform.position;
	}
	
	// Update is called once per frame
	void Update ()
    {
		if(focusingTransform != null)
        {
            transform.position = fixedDisplacement + focusingTransform.position;
        }
	}

    public void SetFocusing(Transform trans)
    {
        focusingTransform = trans;
    }
}
